package com.langfeiyes.pattern.builder;

//可乐生产线
public class ColaBuilder implements IBuilder{
    private String ingredient;  //配料
    private String packing;    //瓶子的包装
    private String drink;        //饮料
    @Override
    public IBuilder ingredientHandler(String ingredient) {
        this.ingredient = ingredient;
        return this;
    }
    @Override
    public IBuilder fillDrink(String drink) {
        this.drink = drink;
        return this;
    }
    @Override
    public IBuilder packing(String packing) {
        this.packing = packing;
        return this;
    }
    @Override
    public Cola build() {
        Cola cola = new Cola();
        cola.setPacking(this.packing);
        cola.setIngredient(this.ingredient);
        cola.setDrink(this.drink);
        return cola;
    }
}
